using System;
using FairyGUI;
using UnityEngine;

namespace SimpleCore
{
    public partial class UIWindow
    {
        public static void SetDefaultScreenSize(int width, int height)
        {
            GRoot.inst.SetContentScaleFactor(width, height);
            _designSize = new Vector2Int(width, height);
        }

        public static void SetGolbalModalWindow(string windowUrl)
        {
            UIConfig.globalModalWaiting = windowUrl;
        }

        public static void SetWindowModalWindow(string windowUrl)
        {
            UIConfig.windowModalWaiting = windowUrl;
        }

        /// <summary>
        /// 设置左右黑边百分比
        /// </summary>
        /// <param name="percent">0~100</param>
        public static void SetWidthBlackBorderPercent(float percent)
        {
            _widthBlackBorderPercent = percent;
        }

        public static void SetBlackBorderWindow<T>() where T : UIWindow, new()
        {
            _blackBorderWindow = UIWindow.Open<T>();
            _blackBorderWindow.sortingOrder = 9999; //黑边在最上 && TODO:如果用了多相机这里需要修改
        }

        /// 
        /// 上下的黑边不提供设置
        /// 

        private static float _widthBlackBorderPercent;

        private static Vector2Int _designSize;
    }
}